Machine or xe2x80x9cartificialxe2x80x9d vision systems are commonly employed for the automated inspection of objects. In manufacturing applications for example, machine vision systems distinguish those objects manufactured within acceptable tolerance levels (i.e. xe2x80x9cgood partsxe2x80x9d), from objects manufactured outside acceptable tolerance levels (xe2x80x9cbad partsxe2x80x9d).
Contemporary automated inspection techniques include generally the steps of statistical training and run-time inspection. During statistical training, a number of acceptable objects are presented that can be at a range of positions and orientations relative to the vision system. The system interrogates the objects and formulates statistical images of the acceptable objects. In current systems, the statistical images comprise a template, or average, image, and an acceptable statistical variation of the average image, referred to as threshold image, which is often computed from a variance or standard deviation image.
The information learned about the object during statistical training is, in turn, applied to the run-time inspection of parts of unknown quality. The run-time images obtained during run-time inspection are compared to the template image and the differences are analyzed. Where the analyzed differences exceed a known, predetermined value, the part is considered a defect. Otherwise, the part is acceptable.
Both statistical training and run-time inspection processes include the steps of registration and computation. During registration, an alignment of the object image or xe2x80x9ctargetxe2x80x9d relative to an alignment model origin is performed. The output of the alignment process is the spatial coordinates of a predetermined origin of the target relative to the alignment model origin. In contemporary systems, the spatial coordinates comprise a real number including a whole pixel portion and a sub-pixel portion. Translation of the whole pixel portion is relatively straightforward. A well-known technique referred to as xe2x80x9cre-windowingxe2x80x9d is used to perform this translation.
Computation of the sub-pixel portion, on the other hand, is quite complicated. Conventional training processes employ a technique called sub-pixel binning in which each pixel in the image is quantized into a number of sub-pixels. The goal of this process is to build a template image and a threshold image for each bin, thereby improving the resolution of statistical training. During run-time, the run-time image is compared to the template image. The origin of the run-time image is analyzed during an alignment procedure, and the appropriate pixel bin determined. The run-time image and the binned template image (average) are then compared on a pixel-by-pixel basis, depending on the selected bin.
Computations during training and run-time involving the sub-pixel binned images require a significant amount of storage space. During training, each sub-pixel bin requires at least two accumulatorsxe2x80x94one for the template image and one for the threshold image. As more sub-pixel bins are added to improve system resolution and therefore lower inspection errors due to sub-pixel misregistration, the system is further burdened by the need for additional storage and image accumulators. Furthermore, the quality of the statistics of each sub-pixel bin is a direct function of the amount and quality of training data stored in the bin. If a bin does not contain much training data, then statistics in that bin are relatively poor and therefore inspection errors are more likely to occur.
The present invention is directed to a method and system for statistical training of a machine vision system on an object, and is further directed to a method and system for automated inspection of objects using the results of such statistical training. The invention addresses the aforementioned limitations of conventional techniques, and provides an inspection. process which is relatively less demanding on system storage, and improves system speed and accuracy.
During statistical training and automated inspection of objects by the machine vision system of the present invention, a General Affine Transform is advantageously employed to improve system performance. During statistical training, the affine poses of a plurality of training images are determined with respect to an alignment model image. Following filtering to remove selected spatial frequency content, the training images and their corresponding affine poses are applied to an affine transformation. The resulting transformed images are accumulated to compute template and threshold images to be used for run-time inspection.
During run-time inspection, the affine pose of the run-time image relative to the alignment model image is determined. Following filtering of the run-time image, the run-time image is affine transformed by its affine pose. The resulting transform image is compared to the template and threshold images computed during statistical training to determine object status. In this manner, automated training and inspection is relatively less demanding on system storage, and results in an improvement in system speed and accuracy.
In one embodiment, the present invention is directed to a method for statistical training of an artificial vision system on an object. A plurality of training images are generated by iteratively imaging one or a number of training objects. The affine pose of each training image with respect to an alignment model image is next determined. Each training image is prefiltered to generate filtered images. Each filtered image is transformed with its corresponding affine pose to generate a plurality of transformed images. A template image and threshold image of the object are then computed from the plurality of transformed images.
In another embodiment, the present invention is directed to a method for automated inspection of an object. The object is first imaged to generate a run-time image. The affine pose of the run-time image with respect to an alignment model image is then determined. The run-time image is prefiltered to generate a filtered image. The filtered image is transformed with its affine pose to generate a transformed image. The transformed image is mean-corrected by the template image, and the mean-corrected image is compared with a threshold image to produce an error image. The error image is analyzed to determine object status.
The alignment model image may be selected as one of or a part of one of the training images collected during statistical training. A geometric model of the object may also be employed as an alignment model image.
In a preferred embodiment, the template image comprises an average image of the transformed training images, while the threshold image comprises an allowable variation of the average image, for example, a linear function of a standard deviation image.
The affine pose is preferably computed by determining the General Affine Transform parameters which accurately map the training and run-time images to the alignment model image.
During prefiltering, the training and run-time images are convolved with a kernel suitable for eliminating high spatial frequency elements from the image that match the worst-case spatial frequency effects of the affine interpolator. In one embodiment, the kernel comprises an impulse function.
The process of transforming the filtered training and run-time images preferably comprises applying the image and the parameters of the corresponding affine pose to a General Affine Transform, such that the transformed training images are properly aligned for computing the template and threshold images, and such that the transformed run-time image is properly aligned with the template and threshold images for comparison thereof. The comparison of the transformed run-time image with the template image is preferably performed by a process referred to as double subtraction.